/*
 * @Descripttion: $0
 * @version: 
 * @Author: linPing
 * @Date: 2019-10-31 11:03:42
 * @LastEditTime: 2019-10-31 20:24:10
 */
import PhotoBrowser from 'react-native-photo-browser';
import React, { Component } from 'react';
import NavigationUtil from '../navigator/NavigationUtil'

class PhotoBrowserScene extends Component {
    constructor(props){
        super(props)
        const { params } = this.props.navigation.state;
        this.media = params.media
     
        this.index = params.index || 0
    }
    static navigationOptions = {
        //1.隐藏导航头部
        header: null,
    };
    _goBack = () => {
        //2.点击返回关闭页面
   
       NavigationUtil.goBack(this.props.navigation);
    }
    render() {
        return (
            <PhotoBrowser
                onBack={this._goBack}
                mediaList={this.media}
                initialIndex={this.index}
                displayActionButton={true}
                displayTopBar={true}
            />
        );
    }
}


/*onPress={()=>{
    // 需显示的图片列表
    let media = [{
        photo: "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1556825030,1264349194&fm=27&gp=0.jpg",
    }, {
        photo: "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1556825030,1264349194&fm=27&gp=0.jpg"
    }]

    const { navigate } = this.props.navigation
    navigate('Photo', {media:media, index:0})

}}*/
export default PhotoBrowserScene;
